import Vue from 'vue'
import Vuex from 'vuex'
// import Cookies from 'js-cookie'

Vue.use(Vuex)
const key = 'token'
const store = new Vuex.Store({
	state() {
		return {
			// token:Cookies.get('token')||null,
			// token: localStorage.getItem('token') ? localStorage.getItem('token') : null,
			isCollapse:false,
			// swzVal:localStorage.getItem('swzVal')||null
		}
	},
	getters: {

	},
	mutations: {
		// setToken(state,val){
		// 	state.token=val
		// 	Cookies.set('token',val)
		// },
		changeCollapse(state){
			console.log(777);
			if(state.isCollapse){
				state.isCollapse=false
			}else{
				state.isCollapse=true
			}
			// if(state.isCollapse==true){
			// 	state.isCollapse=false
			// }else{
			// 	state.isCollapse=true
			// }
		},
		// logOut(state){
		// 	state.token = null;
		// 	localStorage.removeItem("token");
		// 	localStorage.removeItem("name");
		// 	localStorage.removeItem("shiro");
		// },
		// getSwz(state,val){
		// 	state.swzVal=val
		// 	localStorage.setItem('swzVal',val)
		// },
		// $_setStorage(state, value) {
		// 	state.token = value;
		// 	localStorage.setItem('token', value)
		// },
	},
})
export default store